#!/Users/timmenzies/opt/gawk/bin/gawk -f 
 
# randarff.awk
# Revision: 296
# Built by timmenzies on Fri Jul 29 20:43:58 PDT 2011.

#   _ _ _                                               ((
#  |=|=|=|.----------------------------------------.    _))_
#  |-|-|-|| AWK code of a tiny book on data mining | ___\__/)_
#  |_|_|_|'----------------------------------------| |_|_~~_|_|

# This file is part of TINY.
#
# TINY is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# TINY is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
#  along with TINY.  If not, see <http://www.gnu.org/licenses/>.

 @include "lib.awk"
 BEGIN   { IGNORECASE= 1; CONVFMT="%.12g"; }
 NR==1   { resetSeed() } 
 /@data/ { In=1 }
 /@/     { Header= Header "\n" $0 ;next }
 In      { Item[rand()]=$0 }
 END     { print Header;
           for(I in Item) 
               print Item[I] }

